package com.googlecode.gaal.vis.impl;

import com.googlecode.gaal.vis.api.NodeStyle;

public class TikzIntervalDrawing extends AbstractTikzDrawing {

    protected static final String EDGE_FORMAT = "\\draw[%s] (%d) -- +(0,-0.6) -| node {%s} (%d);\n";
    protected static final String LABELLED_EDGE_FORMAT = "\\draw[%s] (%d) -- +(0,-0.6) -| node[near end,sloped,above] {%s} (%d);\n";

    public TikzIntervalDrawing(Appendable output) {
        super(output);
    }

    public TikzIntervalDrawing(Appendable output, String caption, String label, double scale, double nodeScale,
            int minNodeSize) {
        super(output, caption, label, scale, nodeScale, minNodeSize);
    }

    public TikzIntervalDrawing(Appendable output, String caption, String label, String placement, double scale,
            double nodeScale, int minNodeSize) {
        super(output, caption, label, placement, scale, nodeScale, minNodeSize);
    }

    @Override
    protected String getEdgeFormat() {
        return EDGE_FORMAT;
    }

    @Override
    protected String getLabelledEdgeFormat() {
        return LABELLED_EDGE_FORMAT;
    }

    @Override
    protected String formatNodeStyle(NodeStyle style) {
        return String.format("%s,rounded corners", super.formatNodeStyle(style));
    }
}
